package com.mrzhou.common.enums.system;

import com.mrzhou.core.enums.BaseCodeEnum;
import com.mrzhou.core.tool.utils.StringUtil;

import javax.validation.constraints.NotNull;

/**
 * @author qiang.zhou
 * 菜单类型枚举
 */
public enum MenuType implements BaseCodeEnum<String, String> {

    M("M", "目录"),

    C("C", "菜单"),

    F("F", "按钮")

    ;

    private final String code;

    private final String des;

    MenuType(String code, String des) {
        this.code = code;
        this.des = des;
    }

    public String code() {
        return this.code;
    }

    @Override
    public String des() {
        return this.des;
    }

    /**
     * 忽略大小写比较
     * @param type
     * @return
     */
    public boolean equals(String type) {
        if (null != type) {
            return this.code.equalsIgnoreCase(type);
        }
        return false;
    }

}
